import { ElMessageBox, ElMessage } from 'element-plus';
// import { useStore } from 'vuex';
// const store = useStore();
import store from '@/store';
export const deleteDialog = (
  deleteFum: string,
  deleteParams?: any,
  successFoo?: any
) => {
  console.log(store);
  ElMessageBox.confirm('确定要删除用户吗', '删除用户', {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    distinguishCancelAndClose: true
  })
    .then(() => {
      store.dispatch(`${deleteFum}`, deleteParams).then(() => {
        ElMessage({
          type: 'success',
          message: `删除成功`
        });
        if (successFoo) {
          successFoo();
        }
      });
    })
    .catch(() => {
      ElMessage({
        type: 'info',
        message: '取消删除'
      });
    });
};
